/* Copyright (C) 2004 Stefan Bellon <sbellon@sbellon.de>
 *
 * This file is part of RemotePrinterFS.
 *
 * RemotePrinterFS is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * RemotePrinterFS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 */

#include "config.h"
#include "errors.h"

/* This is the separately allocated error block for RemotePrinterFS
   Use only up to 0x0081be7F as 0x0081be80 onwards is used by JetDirectFS */
#define FSErrBase 0x0081be00

/* This is the error block that comes with the filing system but must get
   used accordingly, i.e. only filing system errors may be generated */
// #define FSErrBase ((0x100 + FilingSystemNumber) << 8)

#define DEFERR(name,val,msg)     \
  const struct name              \
  {                              \
    int  errnum;                 \
    char errmess[sizeof(msg)+1]; \
  } name = { val, msg }

DEFERR(err_Unsupported,    FSErrBase + 0, "Unsupported operation");
DEFERR(err_NoMemory,       FSErrBase + 1, "No memory");
DEFERR(err_InvalidAddress, FSErrBase + 2, "Invalid network address");
DEFERR(err_UnknownNetwork, FSErrBase + 3, "Unknown network type");
DEFERR(err_UnknownService, FSErrBase + 4, "Unknown service");
DEFERR(err_NameLookup,     FSErrBase + 5, "Name lookup failed");
DEFERR(err_Socket,         FSErrBase + 6, "Couldn't create socket");
DEFERR(err_LocalAddress,   FSErrBase + 7, "Assignment of local address failed");
DEFERR(err_RemoteAddress,  FSErrBase + 8, "Connect to remote address failed");
DEFERR(err_ServerError,    FSErrBase + 9, "Server error signaled");
DEFERR(err_InvalidSpecialField, FSErrBase + 10, "Error in special field");
DEFERR(err_InternalError,  FSErrBase + 11, "An internal error has occurred");
DEFERR(err_SpoolFile,      FSErrBase + 12, "Cannot open spool file");
#undef DEFERR

os_error const *error;
